<?php
namespace tp5_lib\connect\controller;

use connect\base\HttpsJsonConnect;
use connect\base\HttpsQueryConnect;

/**
 * 测试基础功能被动接收回调时，被调用的接口
 */
class Callback
{
    public function index()
    {
        return 'Callback:测试基础功能需要的回调接口';
    }
    public function json()
    {
        $connect=new HttpsJsonConnect;
        if($_SERVER["REQUEST_METHOD"]==="GET"){
            $connect->disposeGetResquest($params);
            $connect->reply([$params,"HttpsJsonConnect"]);
        }
        else{
            $connect->disposePostResquest($params,$data);
            $connect->reply([$params,$data,"HttpsJsonConnect"]);
        }
    }
    public function query()
    {
        $connect=new HttpsQueryConnect;
        if($_SERVER["REQUEST_METHOD"]==="GET"){
            $connect->disposeGetResquest($params);
            $connect->reply([$params,"HttpsQueryConnect"]);
        }
        else{
            $connect->disposePostResquest($params,$data);
            $connect->reply([$params,$data,"HttpsQueryConnect"]);
        }
    }
}
